<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
<HTML
><HEAD
><TITLE
>Prerequisites for Building the Source Code</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"/><LINK
REL="HOME"
TITLE="Cygwin/X Contributor's Guide"
HREF="cygwin-x-cg.html"/><LINK
REL="UP"
TITLE="Programming"
HREF="programming.html"/><LINK
REL="PREVIOUS"
TITLE="Cygwin/X X Server
Architecture"
HREF="prog-server-architecture.html"/><LINK
REL="NEXT"
TITLE="Obtaining the Source Code"
HREF="prog-obtaining-source.html"/><META
HTTP-EQUIV="Content-Type"
CONTENT="text/html;charset=utf-8"/></HEAD
><BODY
CLASS="sect1"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>Cygwin/X Contributor's Guide</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="prog-server-architecture.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
>Chapter 2. Programming</TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="prog-obtaining-source.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"/></DIV
><DIV
CLASS="sect1"
><H1
CLASS="sect1"
><A
NAME="prog-build-prerequisites"
>Prerequisites for Building the Source Code</A
></H1
><DIV
CLASS="sect2"
><H2
CLASS="sect2"
><A
NAME="prog-compiling-required-packages"
>Required Packages for Building</A
></H2
><P
>Many developer libraries and developer tools are required to
build Cygwin/X.  Several packages are required in addition to the
default packages installed by the Cygwin installer.  Following is a
list of additional packages that are required to compile Cygwin/X
natively in Cygwin.  Note that some of these packages are meta
packages that will automatically cause several other packages to be
selected for installation; do not unselect any of these automatically
selected packages.</P
><UL
><LI
><P
>Required tools:</P
><P
>&#13;autoconf,
automake,
binutils,
bison,
bzip2,
cygport,
diffutils,
fileutils,
findutils,
flex,
gawk,
gcc-core,
git,
libtool,
make,
patch,
pkg-config,
python3,
sed,
tar
</P
></LI
><LI
><P
>Required protocol headers:</P
><P
>&#13;bigreqsproto,
compositeproto,
damageproto,
dmxproto,
fixesproto,
fontsproto,
glproto,
inputproto,
kbproto,
presentproto,
randrproto,
recordproto,
renderproto,
resourceproto,
scrnsaverproto,
windowsdriproto,
xcmiscproto,
xextproto,
xf86bigfontproto,
xineramaproto,
xproto
</P
></LI
><LI
><P
>Required development libraries:</P
><P
>&#13;libdmx-devel,
libfontenc-devel,
libfreetype-devel,
libGL-devel,
libpixman1-devel,
libX11-devel,
libXRes-devel,
libXau-devel,
libXaw-devel,
libXdmcp-devel,
libXext-devel,
libXfont-devel,
libXi-devel,
libXinerama-devel,
libXmu-devel,
libXpm-devel,
libXrender-devel,
libXtst-devel,
libxcb-icccm-devel,
libxcb-image-devel,
libxcb-keysyms-devel,
libxcb-randr-devel,
libxcb-render-devel,
libxcb-render-util-devel,
libxcb-shape-devel,
libxcb-util-devel,
libxkbfile-devel,
zlib
</P
></LI
><LI
><P
>Required miscellaneous packages:</P
><P
>&#13;font-util,
khronos-opengl-registry,
python3-lxml,
xorg-util-macros,
xtrans
</P
></LI
><LI
><P
>Optional packages for building developer documentation:</P
><P
>&#13;docbook-xml43,
doxygen,
fop,
xmlto,
xorg-sgml-doctools
</P
></LI
></UL
><DIV
CLASS="note"
><BLOCKQUOTE
CLASS="note"
><P
><B
>Note: </B
>
The /usr/share/doc/Cygwin/xorg-server-n.n.n.README file installed with the X server
binary package lists up-to-date runtime and build requirements.
</P
></BLOCKQUOTE
></DIV
><DIV
CLASS="tip"
><BLOCKQUOTE
CLASS="tip"
><P
><B
>Tip: </B
>Use <B
CLASS="command"
>setup -q -P<TT
CLASS="replaceable"
><I
>packagename</I
></TT
>,<TT
CLASS="replaceable"
><I
>packagename</I
></TT
>,<TT
CLASS="replaceable"
><I
>etc.</I
></TT
></B
> to quickly install the
required packages.</P
></BLOCKQUOTE
></DIV
></DIV
><DIV
CLASS="sect2"
><H2
CLASS="sect2"
><A
NAME="prog-compiling-environment-setup"
>Compilation environment setup</A
></H2
><DIV
CLASS="sect3"
><H3
CLASS="sect3"
><A
NAME="prog-compiling-libXfont-linkage-issue"
>libXfont linkage issue</A
></H3
><DIV
CLASS="note"
><BLOCKQUOTE
CLASS="note"
><P
><B
>Note: </B
>
As of libXfont 1.5 and X server 1.16, the linkage issue discussed here should be
resolved.  This section is retained for information only.
</P
></BLOCKQUOTE
></DIV
><P
>&#13;libXfont must be statically linked for the server to start correctly, otherwise
it fails with errors loading all fonts, including the mandatory fixed font.
</P
><P
>&#13;This is due to limitations of Cygwin's current weak symbol handling, which requires
static linking to work correctly.  For example, in libXfont the RegisterFPEFunctions
function is defined weak and should be overloaded with RegisterFPEFunctions defined
in dix/dixfont.c in the xserver.
However, such overloading will only currently work for Cygwin when libXfont is statically
linked with the X server, and not as a shared libary.
</P
><P
>&#13;If Cygwin's libXfont-devel package contains a shared library stub, /usr/lib/libXFont.dll.a,
when building the X server, you must prepare your compilation environment so that the libXfont
shared libary stub is not linked with.
</P
><P
>&#13;A quick and dirty way of achieving this is to move libXFont.la and libXfont.dll.a
aside whilst building the X server.
</P
><P
>&#13;<TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="screen"
>&#13;mv /usr/lib/libXFont.la    /usr/lib/libXFont.la.old
mv /usr/lib/libXFont.dll.a /usr/lib/libXFont.dll.a.old
</PRE
></TD
></TR
></TABLE
>
</P
><P
>&#13;A cleaner way is to generate a customized .pc file for libXfont and arrange for that
to be in your PKG_CONFIG_PATH when ./configuring the X server. For example:
</P
><P
>&#13;<TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="screen"
>&#13;sed -e 's| -lXfont| /usr/lib/libXfont.a|' /usr/lib/pkgconfig/xfont.pc &gt; ~/xfont.pc
export PKG_CONFIG_PATH=~:$PKG_CONFIG_PATH
</PRE
></TD
></TR
></TABLE
>
</P
></DIV
></DIV
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"/><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="prog-server-architecture.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="cygwin-x-cg.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="prog-obtaining-source.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>Cygwin/X X Server
Architecture</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="programming.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Obtaining the Source Code</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>